# Toolchain Setup
PP=cpp
CX=g++
LD=$(CX)
RM=rm -f

# Compilation Configurations
CXFLAGS=-g -Ilibfetion `pkg-config --cflags gtkmm-2.4 libcurl`
LDFLAGS=-g `pkg-config --libs gtkmm-2.4 libcurl` -Llib
LD32FLAGS=$(LDFLAGS) -lfetion_32
LD64FLAGS=$(LDFLAGS) -lfetion_64

# Objectives
TARGET=linux-fetion
OBJECT=main.o \
	   FetionWindow.o \
	   FetionLoginBox.o \
	   FetionMainBox.o \
	   FetionStatusIcon.o \
	   FetionDialogWindow.o
DEPEND=$(OBJECT:.o=.dep)

# Procedures
fetion32 : $(OBJECT)
	$(LD) -o $(TARGET) $(OBJECT) $(LD32FLAGS)

fetion64 : $(OBJECT)
	$(LD) -o $(TARGET) $(OBJECT) $(LD64FLAGS)

clean :
	$(RM) $(TARGET) $(OBJECT) $(DEPEND)

help :
	@echo "make [fetion32 | fetion64 | clean | help}"
	@echo "	fetion32 : Linux Fetion for i386."
	@echo "	fetion64 : Linux Fetion for amd64."
	@echo "	clean : Clean linux-fetion *.o *.deb"
	@echo "	help : Show help information."

# Standard Procedures
%.dep : %.cpp
	@$(PP) $(CXFLAGS) -MM -MT $(@:.dep=.o) -o $@ $<

%.o : %.cpp
	$(CX) $(CXFLAGS) -c -o $@ $<

-include $(DEPEND)

